{
  "properties" : { },
  "id" : "copy1723774954664d84340",
  "script" : null,
  "groupId" : "c0cf605f74e34bc6953194a869f4a6cd",
  "name" : "A查询地区实时天气情况(分页查询)",
  "createTime" : 1732780546801,
  "updateTime" : 1730792122188,
  "lock" : null,
  "createBy" : "admin",
  "updateBy" : "admin",
  "path" : "/regionweatherbypage",
  "method" : "GET",
  "parameters" : [ {
    "name" : "regioncode",
    "value" : "220",
    "description" : "行政区划编码查询 不填查全部",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "time",
    "value" : "",
    "description" : "数据可以按找小时获取  yyyy-MM-ddTHH:00:00",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "page",
    "value" : null,
    "description" : "页号",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : "1",
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "size",
    "value" : null,
    "description" : "每页大小",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : "10",
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 0,\n    \"message\": \"success\",\n    \"data\": {\n        \"total\": 44,\n        \"list\": [\n            {\n                \"stationKey\": \"54161\",\n                \"lat\": 43.8914,\n                \"lon\": 125.2317,\n                \"high\": 236.8,\n                \"city\": \"长春市\",\n                \"stationName\": \"长春\",\n                \"cnty\": \"绿园区\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 995.7,\n                \"pres_sea\": 1024.9,\n                \"temp\": 5.3,\n                \"temp_max\": 5.3,\n                \"temp_min\": 4.7,\n                \"humi\": 51,\n                \"humi_min\": 51,\n                \"prec\": 0,\n                \"win_10_dir\": 351,\n                \"win_10_vel\": 1,\n                \"win_inst_dir\": 328,\n                \"win_inst_vel\": 4,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220106\",\n                \"norainday\": 27,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54165\",\n                \"lat\": 43.5472,\n                \"lon\": 125.6414,\n                \"high\": 218.8,\n                \"city\": \"长春市\",\n                \"stationName\": \"双阳\",\n                \"cnty\": \"双阳区\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 997.5,\n                \"pres_sea\": 1024.4,\n                \"temp\": 5.9,\n                \"temp_max\": 5.9,\n                \"temp_min\": 4.6,\n                \"humi\": 53,\n                \"humi_min\": 52,\n                \"prec\": 0,\n                \"win_10_dir\": 18,\n                \"win_10_vel\": 1,\n                \"win_inst_dir\": 139,\n                \"win_inst_vel\": 1.9,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220112\",\n                \"norainday\": 22,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54069\",\n                \"lat\": 44.1228,\n                \"lon\": 125.7992,\n                \"high\": 173.7,\n                \"city\": \"长春市\",\n                \"stationName\": \"九台\",\n                \"cnty\": \"九台区\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 1003.3,\n                \"pres_sea\": 1024.8,\n                \"temp\": 6.2,\n                \"temp_max\": 6.4,\n                \"temp_min\": 4.7,\n                \"humi\": 47,\n                \"humi_min\": 45,\n                \"prec\": 0,\n                \"win_10_dir\": 360,\n                \"win_10_vel\": 1,\n                \"win_inst_dir\": 338,\n                \"win_inst_vel\": 2.5,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220113\",\n                \"norainday\": 22,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54064\",\n                \"lat\": 44.3947,\n                \"lon\": 125.1561,\n                \"high\": 170.4,\n                \"city\": \"长春市\",\n                \"stationName\": \"农安\",\n                \"cnty\": \"农安县\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 1003.5,\n                \"pres_sea\": 1024.7,\n                \"temp\": 6,\n                \"temp_max\": 6,\n                \"temp_min\": 4.7,\n                \"humi\": 51,\n                \"humi_min\": 51,\n                \"prec\": 0,\n                \"win_10_dir\": 24,\n                \"win_10_vel\": 1.9,\n                \"win_inst_dir\": 353,\n                \"win_inst_vel\": 4.2,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220122\",\n                \"norainday\": 27,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54072\",\n                \"lat\": 44.8497,\n                \"lon\": 126.5206,\n                \"high\": 195.2,\n                \"city\": \"长春市\",\n                \"stationName\": \"榆树\",\n                \"cnty\": \"榆树市\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 1000.5,\n                \"pres_sea\": 1024.8,\n                \"temp\": 5.7,\n                \"temp_max\": 5.9,\n                \"temp_min\": 3.8,\n                \"humi\": 52,\n                \"humi_min\": 52,\n                \"prec\": 0,\n                \"win_10_dir\": 275,\n                \"win_10_vel\": 1.3,\n                \"win_inst_dir\": 333,\n                \"win_inst_vel\": 3,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220182\",\n                \"norainday\": 27,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54065\",\n                \"lat\": 44.5356,\n                \"lon\": 125.6572,\n                \"high\": 168.3,\n                \"city\": \"长春市\",\n                \"stationName\": \"德惠\",\n                \"cnty\": \"德惠市\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 1003.5,\n                \"pres_sea\": 1024.4,\n                \"temp\": 6.9,\n                \"temp_max\": 7,\n                \"temp_min\": 5,\n                \"humi\": 48,\n                \"humi_min\": 48,\n                \"prec\": 0,\n                \"win_10_dir\": 41,\n                \"win_10_vel\": 1.1,\n                \"win_inst_dir\": 261,\n                \"win_inst_vel\": 3.1,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220183\",\n                \"norainday\": 27,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54156\",\n                \"lat\": 43.505,\n                \"lon\": 124.7867,\n                \"high\": 198,\n                \"city\": \"长春市\",\n                \"stationName\": \"公主岭\",\n                \"cnty\": \"公主岭市\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 1000.3,\n                \"pres_sea\": 1024.9,\n                \"temp\": 4.8,\n                \"temp_max\": 4.8,\n                \"temp_min\": 3.1,\n                \"humi\": 58,\n                \"humi_min\": 56,\n                \"prec\": 0,\n                \"win_10_dir\": 280,\n                \"win_10_vel\": 0.6,\n                \"win_inst_dir\": 315,\n                \"win_inst_vel\": 1.7,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220184\",\n                \"norainday\": 27,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54172\",\n                \"lat\": 43.8619,\n                \"lon\": 126.5397,\n                \"high\": 290.4,\n                \"city\": \"吉林市\",\n                \"stationName\": \"吉林城郊\",\n                \"cnty\": \"昌邑区\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 988.6,\n                \"pres_sea\": 1024,\n                \"temp\": 7.5,\n                \"temp_max\": 7.6,\n                \"temp_min\": 5.5,\n                \"humi\": 42,\n                \"humi_min\": 42,\n                \"prec\": 0,\n                \"win_10_dir\": 288,\n                \"win_10_vel\": 1,\n                \"win_inst_dir\": 275,\n                \"win_inst_vel\": 3.2,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220202\",\n                \"norainday\": 22,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54171\",\n                \"lat\": 43.6808,\n                \"lon\": 126.5183,\n                \"high\": 229.8,\n                \"city\": \"吉林市\",\n                \"stationName\": \"永吉\",\n                \"cnty\": \"永吉县\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 995.8,\n                \"pres_sea\": 1023.9,\n                \"temp\": 7.7,\n                \"temp_max\": 7.7,\n                \"temp_min\": 4.5,\n                \"humi\": 58,\n                \"humi_min\": 57,\n                \"prec\": 0,\n                \"win_10_dir\": 15,\n                \"win_10_vel\": 0.8,\n                \"win_inst_dir\": 218,\n                \"win_inst_vel\": 2,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220221\",\n                \"norainday\": 21,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54181\",\n                \"lat\": 43.7006,\n                \"lon\": 127.3322,\n                \"high\": 295.8,\n                \"city\": \"吉林市\",\n                \"stationName\": \"蛟河\",\n                \"cnty\": \"蛟河市\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 987.8,\n                \"pres_sea\": 1023.8,\n                \"temp\": 7.5,\n                \"temp_max\": 7.6,\n                \"temp_min\": 4.6,\n                \"humi\": 50,\n                \"humi_min\": 48,\n                \"prec\": 0,\n                \"win_10_dir\": 189,\n                \"win_10_vel\": 1,\n                \"win_inst_dir\": 197,\n                \"win_inst_vel\": 2.2,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"220281\",\n                \"norainday\": 21,\n                \"wep_value\": null\n            }\n        ]\n    },\n    \"timestamp\": 1730789618001,\n    \"executeTime\": 732\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "1",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "success",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "Hello magic-api",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "timestamp",
      "value" : "1723701688631",
      "description" : "",
      "required" : false,
      "dataType" : "Long",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "executeTime",
      "value" : "174",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
/**
 *   按照机构号码查询、
 *  @param   regioncode  行政区划编码查询不填查全部
 *  @param   time        时间格式数据可以按找小时获取  yyyy-MM-ddTHH:00:00   不传查最新 传查指定时间  必须传入整点数据
 *  @param   page   默认 1
 *  @param   size   默认 20
 */
var sql = """
    select t1.*,w.wep_value from stationdata_region t1  
    join( select stationKey ,max(timeBase) as latest_timestamp 
    from stationdata_region
    where 1 = 1 
    <if test="regioncode != null and regioncode != ''" > and code LIKE CONCAT(#{regioncode},'%') </if>
    <if test="time != null and time != ''\" > and DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s') = timeBase </if>
    group by stationKey
    )  t2 on t1.stationKey = t2.stationKey and t1.timeBase = t2.latest_timestamp 
    left  join wep_dic w on w.wep_key =  t1.WEP_Now

     order by code 
"""

return db.page(sql);